class MobileController < ApplicationController
  layout "mobile"

  def payload(token)
    JsonWebToken.decode(token)
  rescue
    nil
  end

  def load_current_user(token)
    @current_user = User.find_by(id: payload(token)[0]['user_id'])
  end

end